﻿
// ClientDoc.h: CClientDoc 类的接口
//


#pragma once


class CClientDoc : public CDocument
{
protected: // 仅从序列化创建
    CClientDoc() noexcept;
    DECLARE_DYNCREATE(CClientDoc)

    // 特性
public:

    // 操作
public:

    // 重写
public:
    virtual BOOL OnNewDocument();
    virtual void Serialize(CArchive& ar);
#ifdef SHARED_HANDLERS
    virtual void InitializeSearchContent();
    virtual void OnDrawThumbnail(CDC& dc, LPRECT lprcBounds);
#endif // SHARED_HANDLERS

    // 实现
public:
    virtual ~CClientDoc();
#ifdef _DEBUG
    virtual void AssertValid() const;
    virtual void Dump(CDumpContext& dc) const;
#endif

protected:

    // 生成的消息映射函数
protected:
    DECLARE_MESSAGE_MAP()

#ifdef SHARED_HANDLERS
    // 用于为搜索处理程序设置搜索内容的 Helper 函数
    void SetSearchContent(const CString& value);
#endif // SHARED_HANDLERS

public:
    IOleClientSite* GetClientSite();
    IAdviseSink* GetAdviseSink();

public:
    DECLARE_INTERFACE_MAP()

    BEGIN_INTERFACE_PART(COleClientSite, IOleClientSite)
        virtual HRESULT STDMETHODCALLTYPE SaveObject();
    virtual HRESULT STDMETHODCALLTYPE GetMoniker(
        IN DWORD dwAssign,
        IN DWORD dwWhichMoniker,
        OUT IMoniker** ppmk
    );
    virtual HRESULT STDMETHODCALLTYPE GetContainer(OUT IOleContainer** ppContainer);
    virtual HRESULT STDMETHODCALLTYPE ShowObject();
    virtual HRESULT STDMETHODCALLTYPE OnShowWindow(IN BOOL fShow);
    virtual HRESULT STDMETHODCALLTYPE RequestNewObjectLayout();
    END_INTERFACE_PART(COleClientSite)

    BEGIN_INTERFACE_PART(COleAdviseSink, IAdviseSink)
    virtual void STDMETHODCALLTYPE OnDataChange(
            IN FORMATETC* pFormatetc, 
            IN STGMEDIUM* pStgmed
        );
    virtual void STDMETHODCALLTYPE OnViewChange(IN DWORD dwAspect, IN LONG lindex);
    virtual void STDMETHODCALLTYPE OnRename(IN  IMoniker* pmk);
    virtual void STDMETHODCALLTYPE OnSave();
    virtual void STDMETHODCALLTYPE OnClose();
    END_INTERFACE_PART(COleAdviseSink)
};
